//Utility functions
function merge(s, a) {
    if (a && s) for (var c in a){s[c]=a[c];}return s;
}

function isFunction(obj) {
  return !!(obj && obj.constructor && obj.call && obj.apply);
}

function isArray(obj) {
    return obj instanceof Array;
}